Skip to content

add managed CodingAgentConfig read client, normalize, and local persist - #262

Closed
asujithan wants to merge 6 commits into
mainfrom
asujithan/managed-config
Closed

add managed CodingAgentConfig read client, normalize, and local persist#262
asujithan wants to merge 6 commits into
mainfrom
asujithan/managed-config

Conversation

@asujithan

@asujithan asujithan commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Changes

Developer-read side of [Coding Gateway Configuration Management]). Adds the data layer that lets a developer's ucode pull the org admin's CodingAgentConfig and stores it locally to ~/.ucode/managed-state.json, so later PRs can reconcile it against local state and apply it to agents.

This PR is the foundation only — no CLI wiring or agent application yet (those are follow-up PRs). Nothing here runs during a real ucode/ucode configure command; it's exercised by tests.

Changes

  • databricks.py: fetch_managed_coding_agent_configs(workspace, token) — reads the workspace's config via the non-admin List endpoint (GET /api/ai-gateway/v2/coding-agent-configs), returning raw manifest dicts or an actionable reason. Workspace is resolved server-side, so no id is needed.
  • managed_config.py (new):
    • normalize_managed_config — proto-JSON → ucode-native shape (maps CODING_AGENT_*/MCP_SERVER_TYPE_* enums to ucode tool/type names; drops agents/types this build doesn't recognize).
    • get_managed_config — fetch + normalize, with a 3-way return (config / no-config / error).
    • save/load/delete_managed_state — persist to ~/.ucode/managed-state.json (0600; load is workspace-scoped so a stale file is ignored).

Test Plan

  • Tests: 22 cases covering normalization, the fetch client's parsing/error paths, and persistence (round-trip, 0600, workspace-scoping).

Not in this PR (follow-ups )

  • Reconcile managed vs local state + apply manifest to agents/MCP/skills/tracing.
  • ucode configure gating + bare-ucode Path A wiring.
  • Sudo/root-ownership enforcement of managed-state.json (0600 is an interim best-effort; real enforcement needs a privileged path + elevation and is its own change).

Comment thread src/ucode/managed_config.py
@asujithan
asujithan enabled auto-merge (squash) August 4, 2026 15:07
@asujithan

Copy link
Copy Markdown
Collaborator Author

Closing, will instead merge #263 which will skip e2e tests (failing due to unrelated codex models list error)

@asujithan
asujithan disabled auto-merge August 4, 2026 18:25
@asujithan asujithan closed this Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants